@echo off
echo ========================================
echo Hash Storage GUI - Build Executable
echo ========================================
echo.

echo Installing PyInstaller if needed...
python -m pip install pyinstaller

echo.
echo Building executable...
python -m PyInstaller --onefile --windowed --name=HashStorage --icon=gui_ico.ico --hidden-import=PyQt5.QtCore --hidden-import=PyQt5.QtGui --hidden-import=PyQt5.QtWidgets --hidden-import=requests --hidden-import=pathlib gui.py

echo.
if exist "dist\HashStorage.exe" (
    echo ========================================
    echo BUILD SUCCESSFUL!
    echo ========================================
    echo Executable created at: dist\HashStorage.exe
    for %%I in ("dist\HashStorage.exe") do echo File size: %%~zI bytes
    echo.
    echo You can now distribute the HashStorage.exe file.
) else (
    echo ========================================
    echo BUILD FAILED!
    echo ========================================
    echo Please check the error messages above.
)

echo.
echo Press any key to exit...
pause >nul